<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>Document</title>
    </head>
    <body>
        <h1>666</h1>
        <script>
            console.log(2222);
            function B() {
                console.log('B...');
            }
            console.log(new B());
            B();

            var C = function () {
                console.log('C...');
            };
            console.log(new C());
            C();

            class A {
                constructor(name) {
                    console.log('A...');
                    this.name = name;
                    this.say = () => {
                        console.log(this.name);
                    };
                }
                methods() {
                    console.log('hello ' + this.name);
                }
                age = 777;
                static nn = 123; 
                static m = () => {
                    console.log(this.a);
                };
            }
            // A(); 类不可以调用
            let aa = new A('ookk');
            // console.log(new A());
            console.log(aa);
            console.log(aa.name);
            console.log(aa.age);
            console.log(aa.nn);
            console.log(aa.methods());
            console.log(aa.m()); // TypeError: aa.m is not a function
        </script>
    </body>
</html>
